home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
C
/
LIB
/
DESK
/
CORE
/
Desk
/
h_doc
/
Screen
< prev
next >
Wrap
Text File
|
1996-05-21
|
3KB
|
95 lines
/*
#### # # # #
# # # # # The FreeWare C library for
# # ## ### # # # # ### RISC OS machines
# # # # # # # # # # # ___________________________________
# # #### ### ## # # # #
# # # # # # # # # # Please refer to the accompanying
#### ### #### # # ##### # ### documentation for conditions of use
________________________________________________________________________
File: Screen.h
Author: Copyright © 1992 Jasn Williams
Version: 1.00 (23 Mar 1992)
Purpose: Screen functions (read size, eig factors, etc.)
*/
#ifndef __Desk_Screen_h
#define __Desk_Screen_h
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __Desk_Wimp_h
#include "Desk.Wimp.h"
#endif
/* EXTRA NOTES:
* See Handler.c and '!TestApp.c' for examples of Desk_mode_change handlers to
* automatically keep all these mode variables up-to-date, etc.
*/
/* These variables can be accessed globally for maximum efficiency.
* Note that they are not valid unless Desk_screen_mode == the current screen mode
* This can be guaranteed if you call Desk_Screen_CacheModeInfo() every time
* you get a mode change message, or before you attempt to use these variables
*
* Usage should be:
* Desk_Screen_CacheModeInfo();
* ...
* screenwidth = Desk_screen_size.x; (or whatever)
* ...
*/
#ifdef Desk__using_SDLS
extern int *Desk_Screen__Ref_mode( void);
extern Desk_wimp_point *Desk_Screen__Ref_size( void);
extern Desk_wimp_point *Desk_Screen__Ref_eig( void);
extern Desk_wimp_point *Desk_Screen__Ref_delta( void);
extern int *Desk_Screen__Ref_bpp( void);
#endif
#if defined( Desk__using_SDLS) && !defined( Desk__making_Misc)
#define Desk_screen_mode (*Desk_Screen__Ref_mode())
#define Desk_screen_size (*Desk_Screen__Ref_size())
#define Desk_screen_eig (*Desk_Screen__Ref_eig())
#define Desk_screen_delta (*Desk_Screen__Ref_delta())
#define Desk_screen_bpp (*Desk_Screen__Ref_bpp())
#else
extern int Desk_screen_mode;
extern Desk_wimp_point Desk_screen_size;
extern Desk_wimp_point Desk_screen_eig; /* Log2( Desk_screen_delta) */
extern Desk_wimp_point Desk_screen_delta; /* pixel size in os coors */
extern int Desk_screen_bpp; /* Bits per pixel */
#endif
extern Desk_bool Desk_Screen_CacheModeInfo(void);
/*
* This should be called before you try to use any of the above screen
* variables. It only needs to be called whenever the screen mode changes
* so call it:
* a) When you initialise your program, and whenever a mode change
* message is received (see ModeChangeHandler, below)
* b) Immediately before you use the variables (i.e. in your redraw
* handler, etc.)
*
* It checks the screenmode, and if it has not changed, then the variables
* are not updated, so it is not too bad if you call it more often than
* you really need to (i.e. every time you redraw, for example).
*/
#ifdef __cplusplus
}
#endif
#endif